using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using MilitaryPluginInterface;
using GameBase;

namespace MilitaryPluginSoldier
{
    public class MilitaryPlugin : Military, IMilitary
    {
        public override void init(string imgStr, Vector2 pos)
        {
            base.init(imgStr, pos);

            _health.MaxHealth = 120;
            _health.Health = 120;
            _rangeAttack = 200;
            _strengthAttack = 8;
            _defend = 10;
            _targetPosition = pos;
            _speed = 2.5f;
            _delay = 200;
            _produceTime = 5;
            _scale = 1;

            _idle = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this,@"_idle"), 4, pos, _scale, _delay);
            _walk = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_walk"), 5, pos, _scale, _delay);
            _attack = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_attack"), 6, pos, _scale, _delay);
            _die = new OneTimeSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"_die"), 7, pos, _scale, _delay);
            Bullet = new LoopSprite(GameBase.Texture2DHelper.loadTexture2DFromDLL(this, @"bullet_soldier"), 18, pos, _scale, 70);
            _health.Width = (int)(_idle.LstTexture[0].Width * _idle.Scale);
            _health.Position = pos;

            idle();
        }

        public override Object clone()
        {
            MilitaryPluginSoldier.MilitaryPlugin newSoldier = new MilitaryPluginSoldier.MilitaryPlugin();
            newSoldier.init(_imgStr, Position);
            return newSoldier;
        }

        public override string getName()
        {
            return @"soldier";
        }
    }
}
